package edu.scu.declaresys.dao.impl;

import edu.scu.declaresys.dao.intr.IProjectClassDAO;
import edu.scu.declaresys.exception.ExecuteException;
import edu.scu.declaresys.vo.ProjectClass;

public class ProjectClassDAOImpl extends GeneralDAOImpl<ProjectClass> implements
		IProjectClassDAO
{

	public ProjectClassDAOImpl()
	{
		super(ProjectClass.class);
	}

	@Override
	protected void fillReference(ProjectClass vo, int depth)
			throws ExecuteException
	{
		if(!vo.getId().equals(vo.getParentId()))
		{
			vo.setParent(this.findById(vo.getParentId(), depth - 1));
		}
		vo.setChildren(this.findByProperty(ProjectClass.T_PARENT_ID, vo.getId(), depth - 1, null, null, ProjectClass.T_ID, true));
	}
	
	
}
